package client;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

public class ChatHandler implements Runnable {
	private Socket s;

	public ChatHandler(Socket s) {
		super();
		this.s = s;
	}

	public void run() {
		BufferedReader in = null;
		try {
			in = new BufferedReader(
					new InputStreamReader(
							s.getInputStream()));
			while (true) {
				System.out.println("#" + in.readLine());
				System.out.flush();
			}
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				in.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
